/**
* Copyright(c)
* All rights reserved.
* Author : 1
* Date : 2021-09-08-11.59.39
* Description : 1
*/
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
const int N=1e5+5;
const ll mod=998244353;
int n;
ll a[N];

ll qmi(ll m, ll k)
{
    ll res = 1 % mod, t = m % mod;//细节 res=1%p 考虑到了p=1 k=0 的特殊情况
    while (k)
    {
        if (k&1) res = res * t % mod;//细节保证取模之前即使爆int也没事,也可以将res，t类型初始化为LL
        t = t * t % mod;
        k >>= 1;
    }
    return res;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);

    cin >>n;
    ll res=1;
    for(int i=1;i<=n;i++)
    {
        cin >>a[i];
        a[i]=a[i]%mod;
        res=(res*a[i])%mod;
    }

    for(int i=1;i<=n;i++)
    {
        ll ans=(res%mod*qmi(a[i],mod-2)%mod)%mod;
        if(i==n)
            cout <<ans;
        else
            cout <<ans<<" ";
    }

    return 0;
}
